<%= javascript_include_tag "prototype" %>
<%= javascript_include_tag "util" %>
<%= javascript_include_tag "calendar" %>
<script>
        function checkNull(flag, msg_id, obj_id, msg_text){
                if (flag) {
                        if ($(obj_id).value == "")
                        {
                                $(msg_id).innerText = msg_text;
                                $(msg_id).style.display = "block";
                                return false;
                        }
                        else return true;
                }
                else {
                        $(msg_id).style.display = "none";
                }
        }
        function CheckForm(){
                return checkNull(true,'id_name','store_name','请输入仓库名');
        }
</script>
<h1>仓库管理 - <span id="secondHeading">创建仓库</span></h1>
<%= form_tag({}, :id=>"input-form") %>
		<TABLE border="0" id="INPUT_TABLE">
		<TR>
		<TD colspan="2">
			<% if @flash[:notice] -%>
			<div id="notice"><%= @flash[:notice] %></div>
			<% end -%>
		</TD>
	</TR>
		<TR>
	      <td class="b">仓库名:</td>
              <td><%= text_field("store", "name",:size=>"30", :maxlength=>"100", :onfocus=>"checkNull(false,'id_name')", :onblur=>"checkNull(true,'id_name',this.id,'请输入仓库名')") %>          <em>*</em><div class="redNsg" id="id_name" style="display:none;"></div></td>
	    </tr>
	    <tr>
	      <td class="b">电话:</td>
	      <td><%= text_field("store", "phone",:size=>"30", :maxlength=>"20") %></td>
	    </tr>
	    <tr>
	      <td class="b">地址:</td>
              <td><%= text_field("store", "address",:size=>"50", :maxlength=>"100") %></td>
	    </tr>
	    <tr>
	    	<td class="b">入货仓库<input id="store_in_type" name="store[in_type]" type="checkbox" value="1" /></td>
	    	<td class="b">出货仓库<input id="store_out_type" name="store[out_type]" type="checkbox" value="1" /></td>
	    </tr>
	    <tr>
	      <td colspan="2" align="right"><input type="submit" value="添加" class="sub" onclick="return CheckForm()">&nbsp;OR&nbsp;<input type="reset" value="重新填写" class="cal"></td>
			
			
		</TR>
		</TABLE>
<p class="note"> <strong class="alert">注意：</strong><br/>
 一、有 <em>*</em> 标记的是必填项。
 </p>
<%= end_form_tag %>
